package com.example.demo.core.operator;

import com.alibaba.fastjson.JSONObject;
import com.example.demo.core.enums.RuleOpEnum;
import java.util.List;

/**
 * @author zuitu@foxmail.com
 * @date 2021/1/18
 */
@RuleOp(method = RuleOpEnum.NOT_IN)
public class OpNotIn implements IRuleOp {
    @Override
    public boolean doOp(String myVal, String val) {
        if (myVal == null) {
            return false;
        }
        List<String> list = JSONObject.parseArray(val, String.class);
        return !list.contains(myVal);
    }
}
